package com.yunsom.testdemo.design.iterator;

/**
 * @author Xbao
 * @version 1.0
 * @description 迭代器模式
 * @date 2021/3/10 9:39
 */
public class IteratorTest {

  public static void main(String[] args) {

    Repository repository = new Repository();

    for (Iterator iterator = repository.getIterator(); iterator.hasNext(); ) {
      String name = (String)iterator.next();
      System.out.println("Name:"+name);
    }

  }
}
